#pragma once
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>


class LookGuard
{
public:
    LookGuard(pthread_mutex_t *mutex)
        : _mutex(mutex)
    {
        pthread_mutex_lock(_mutex);
    }
    ~LookGuard()
    {
        pthread_mutex_unlock(_mutex);
    }

private:
    pthread_mutex_t *_mutex;
};